<?php
$this->breadcrumbs=array(
	'Sites'=>array('index'),
	'Manage',
);
$this->menu=array(
	array('label'=>'List Site', 'url'=>array('index')),
	array('label'=>'Create Site', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('site-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Sites</h1>

<div style="width:665px;" class="grid_11">
      <div id="sitesAndPages" class="contents">
          <h3 class="left">Sites &amp; Pages</h3>
          <a class="button right highlight" href="/admin/site/create"><img src="/images/icons/highlight_indicator.gif" class="highlightIndicator"><img src="/images/icons/book_add.png?1314164582" alt="Add New Site"> Add New Site</a>
          <div class="clear"></div>
        </div>
     
</div>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'site-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'sit_code',
		'sit_name',
		'sit_slogan',		
		'sit_title',
		'template.tem_name',
		/*
		'sit_footerText',
		*/
	 array(
                       'class'=>'CLinkColumn',
                       'label'=>CHtml::image(Yii::app()->request->baseUrl."/images/view.png","view").' Ver Páginas',
                       'urlExpression'=>'Yii::app()->createUrl("admin/page/admin",array("site"=>$data->sit_code))',
                       'header'=>'Páginas',
                       'htmlOptions'=>array('id1'=>'enlace',),
               ),
                array(
                       'class'=>'CLinkColumn',
                       'label'=>CHtml::image(Yii::app()->request->baseUrl."/images/view.png","view").'Template',
                       'urlExpression'=>'Yii::app()->createUrl("admin/template/admin",array("site"=>$data->sit_code))',
                       'header'=>'Template',
                       'htmlOptions'=>array('id1'=>'enlace',),
               ),
                array(
                       'class'=>'CLinkColumn',
                       'label'=>CHtml::image(Yii::app()->request->baseUrl."/images/view.png","view").'VER SITIO',
                       'urlExpression'=>'Yii::app()->createUrl("preview/index",array("id"=>$data->sit_code))',
                       'header'=>'Ver Sitio',
                       'htmlOptions'=>array('id1'=>'enlace',),
               ),
                 array(
                       'class'=>'CLinkColumn',
                       'label'=>CHtml::image(Yii::app()->request->baseUrl."/images/view.png","view").'Exportar SITIO',
                       'urlExpression'=>'Yii::app()->createUrl("preview/export",array("id"=>$data->sit_code))',
                       'header'=>'Exportar Sitio',
                       'htmlOptions'=>array('id1'=>'enlace',),
               ),
              
	array(
			'class'=>'CButtonColumn',
			'deleteButtonLabel' => 'Eliminar',
			'updateButtonLabel' => 'Editar',
			'viewButtonLabel' => 'Ver',
			'deleteConfirmation' => 'Desea eliminar este registro?'
		),
	),
)); ?>
